<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title><spring:message code="head.clothGarment"></spring:message>-<spring:message code="head.subjectClassification"></spring:message></title>
    <link href="${pageContext.request.contextPath }/phone/css/list.css" rel="stylesheet" />
    <%-- <link href="${pageContext.request.contextPath }/phone/css/bottom.css" rel="stylesheet" /> --%>
</head>
<body>
    <div>
       
        <!--头部--有分类-->
        <div class="cate_header">
            <div class="putong_top">
                <a href="javascript:history.go(-1);"></a>
                <div><spring:message code="head.subjectClassification"></spring:message></div>
            </div>
        </div>

        <div role="main" class="main" style="margin-top:65px;background:#F0F0F2;">
            <!--主题-->
            <c:if test="${not empty theme }">
            <div class="zhuti">
                <ul>
                    <li>
                            <div class="img_squre2" style="background-image:url(${pageContext.request.contextPath }/upload/compression/${theme.img });"></div>
                            <div class="content2">
                                <h4>${theme.name }</h4>
                                <p>${theme.info }</p>
                            </div>
                    </li>
                    <div class="clr"></div>
                </ul>
            </div>
            </c:if>
            <!--花型-->
            <c:if test="${not empty pList }">
            <div class="huaxing">
                <ul>
                	<c:forEach items="${pList }" var="p">
                    <li>
                        <a href="javascript:xiangqing('${p.isVip}','${p.pId}');">
                            <div class="img_squre" style="background-image:url(${p.pImg });"></div>
                            <span><spring:message code="subjectClassificationDetails.number"></spring:message>：${p.pNo }</span>
                            <br/>
                            <span><spring:message code="subjectClassificationDetails.size"></spring:message>：${p.chicun }cm
                            	<c:if test="${p.isVip==2 }">
	                            <i>VIP</i>
	                            </c:if>
                            </span>
                            
                        </a>
                    </li>
                    </c:forEach>
                    <div class="clr"></div>
                </ul>
           </div>
           </c:if>
        </div>
        <!---bottom底部--->
    <script src="${pageContext.request.contextPath }/phone/js/jquery-1.8.3.min.js"></script>
        <jsp:include page="../main/bottom.jsp" flush="true"><jsp:param name="bottom" value="2"/></jsp:include>
   </div>
    <script language="JavaScript" type="text/JavaScript">
    $(".zhuti").click(function(){
    	if(!$(".content2 p").hasClass("shou")){
        	$(".content2 p").height("auto").addClass("shou");
    	}else{
        	$(".content2 p").height("94px").removeClass("shou");
    	}
    });
    
    
	    function xiangqing(vip,patternId){
			if(vip==2){
			$.ajax({url:'${pageContext.request.contextPath }/web/patternfilter/judge', async : false,type : "POST",  success :function(result){
				 var status=result.msg.status;
				 var desc=result.msg.desc;
				    if(status == 1){//没登录
				    	/* layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
			        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
			        	}, function(index){
			        		location.href="${pageContext.request.contextPath}/api/toPhonePage/login";
			        	},function(index){
			        		
			        	}); */
				    	layer.open({
		       			    content: '<spring:message code="flowertypecatalog.notLogin"></spring:message>'
		       			    ,btn: ['<spring:message code="reciveAddress.confirm"></spring:message>', '<spring:message code="reciveAddress.cancel"></spring:message>']
		       			    ,yes: function(index){
		       			    	location.href="${pageContext.request.contextPath}/api/toPhonePage/login";
		       			      layer.close(index);
		       			    }
		       			  });
				    	flag=true;
				    }else if(status ==2){
				    	/* layer.confirm('<spring:message code="flowertypecatalog.applyForVIP"></spring:message>', {
				        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
				        	  title:'<spring:message code="flowertypecatalog.message"></spring:message>'
				        	}, function(index){
				        		location.href="${pageContext.request.contextPath}/api/toPhonePage/applyForVip";
				        		layer.close(index);
				        	},function(index){
				        		layer.close(index);
				        	}); */
				    	layer.open({
		       			    content: '<spring:message code="flowertypecatalog.applyForVIP"></spring:message>'
		       			    ,btn: ['<spring:message code="reciveAddress.confirm"></spring:message>', '<spring:message code="reciveAddress.cancel"></spring:message>']
		       			    ,yes: function(index){
		       			    	location.href="${pageContext.request.contextPath}/api/toPhonePage/applyForVip";
		       			      layer.close(index);
		       			    }
		       			  });
				    	
				    }else{
				    	top.location.href='${pageContext.request.contextPath}/api/toPhonePage/patternShiyi?id='+patternId;
				    }
			  	}
			});
			}else{
				$.ajax({url:'${pageContext.request.contextPath }/web/patternfilter/judge', async : false,type : "POST",  success :function(result){
		   			 var status=result.msg.status;
		   			 var desc=result.msg.desc;
		   			    if(status == 1){//没登录
		   			    	/* layer.confirm('<spring:message code="flowertypecatalog.notLogin"></spring:message>', {
		   			        	  btn: ['<spring:message code="flowertypecatalog.agreed"></spring:message>','<spring:message code="flowertypecatalog.unagree"></spring:message>'], //按钮
		   			        	title:'<spring:message code="flowertypecatalog.message"></spring:message>'
		   			        	}, function(index){
		   			        		location.href="${pageContext.request.contextPath}/api/toPhonePage/login";
		   			        	},function(index){
		   			        		
		   			        	}); */
		   			    	layer.open({
		   	       			    content: '<spring:message code="flowertypecatalog.notLogin"></spring:message>'
		   	       			    ,btn: ['<spring:message code="reciveAddress.confirm"></spring:message>', '<spring:message code="reciveAddress.cancel"></spring:message>']
		   	       			    ,yes: function(index){
		   	       			    	location.href="${pageContext.request.contextPath}/api/toPhonePage/login";
		   	       			      layer.close(index);
		   	       			    }
		   	       			  });
		   			    	
		   			    }else{
		   			    	top.location.href='${pageContext.request.contextPath}/api/toPhonePage/patternShiyi?id='+patternId;
		   			    }
			}
		});
			}
		}
	</script>

</body>
</html>